package com.hyperplan.neptune;

import java.nio.file.Path;

public class SourceElement {

	private String[] moduleParts;
	private Path path;
	private Path root;
	
	public SourceElement(String[] moduleParts, Path path, Path root) {
		this.moduleParts = moduleParts;
		this.path = path;
		this.root = root;
	}
	
	public String[] getModuleParts() {
		return moduleParts;
	}
	
	public String getModuleName() {
		StringBuilder builder = null;
		for (String part : moduleParts) {
			if (builder != null) {
				builder.append(".");
			} else {
				builder = new StringBuilder();
			}
			builder.append(part);
		}
		return builder.toString();
	}
	
	public Path getPath() {
		return path;
	}
	
	public Path getRoot() {
		return root;
	}
}
